/* 后台管理系统样式 - Admin CSS */

/* 基础样式 */
body {
    background-color: #f8f9fa;
}

/* 侧边栏 */
.sidebar {
    min-height: 100vh;
    background: linear-gradient(180deg, #343a40 0%, #495057 100%);
    width: 250px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.sidebar .nav-link {
    color: #adb5bd;
    padding: 12px 20px;
    border-radius: 5px;
    margin: 2px 15px;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(102, 126, 234, 0.8);
    transform: translateX(5px);
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar .sidebar-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid #495057;
}

.sidebar .sidebar-header h5 {
    color: white;
    margin: 0;
    font-weight: 600;
}

/* 主内容区 */
.main-content {
    margin-left: 250px;
    padding: 0;
    height: 100vh;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏固定 */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 999;
    flex-shrink: 0;
}

/* 内容滚动区域 */
.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* 统计卡片 */
.stat-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background: white;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

/* 移动端警告 */
.mobile-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

/* 顶部导航栏 */
.top-bar {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.top-bar h3 {
    color: #343a40;
    margin: 0;
}

.top-bar .text-muted {
    font-size: 0.9rem;
}

/* 数据表格 */
.data-table {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.data-table .table {
    margin: 0;
}

.data-table .table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    padding: 1rem;
}

.data-table .table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.data-table .table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

/* 操作卡片 */
.action-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    padding: 1.5rem;
}

.action-card .card-title {
    color: #343a40;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* 按钮样式 */
.btn-admin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    border-radius: 5px;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.btn-admin:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    color: white;
}

.btn-admin-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    color: white;
    border-radius: 5px;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.btn-admin-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
    color: white;
}

/* 状态徽章 */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

/* 筛选和搜索 */
.filter-bar {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-bar .form-control,
.filter-bar .form-select {
    border-radius: 5px;
    border: 1px solid #ced4da;
}

.filter-bar .form-control:focus,
.filter-bar .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* 模态框增强 */
.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0.375rem 0.375rem 0 0;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 2rem;
}

/* 仪表板网格 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.dashboard-card .card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 1rem;
}

.dashboard-card .card-title {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.dashboard-card .card-value {
    color: #343a40;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.dashboard-card .card-change {
    font-size: 0.85rem;
    font-weight: 500;
}

.card-change.positive {
    color: #28a745;
}

.card-change.negative {
    color: #dc3545;
}

/* 图表容器 */
.chart-container {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.chart-header {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.chart-title {
    color: #343a40;
    font-weight: 600;
    margin: 0;
}

/* 用户管理 */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-details h6 {
    margin: 0;
    color: #343a40;
    font-weight: 600;
}

.user-details small {
    color: #6c757d;
}

/* 权限管理 */
.permission-group {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.permission-group h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.permission-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f3f4;
}

.permission-item:last-child {
    border-bottom: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 10px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .filter-bar {
        padding: 1rem;
    }
    
    .data-table {
        overflow-x: auto;
    }
}

/* 确保桌面端正常显示 */
@media (min-width: 769px) {
    .mobile-warning {
        display: none;
    }
}

/* 通知和消息 */
.notification-item {
    border-left: 4px solid #667eea;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 1rem;
}

.notification-item.warning {
    border-left-color: #ffc107;
}

.notification-item.danger {
    border-left-color: #dc3545;
}

.notification-item.success {
    border-left-color: #28a745;
}

/* 系统设置 */
.settings-section {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.settings-section h5 {
    color: #343a40;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-label {
    color: #495057;
    font-weight: 500;
}

.setting-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* 内容卡片 */
.content-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    border: none;
}

.content-card .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.25rem;
    border-radius: 10px 10px 0 0;
    font-weight: 600;
}

.content-card .card-body {
    padding: 1.25rem;
}

/* 搜索筛选栏 */
.search-filter-bar {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-filter-bar .form-control,
.search-filter-bar .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.search-filter-bar .form-control:focus,
.search-filter-bar .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* 指标卡片 */
.metric-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: none;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* 趋势指示器 */
.trend-up {
    color: #28a745;
    font-weight: 600;
}

.trend-down {
    color: #dc3545;
    font-weight: 600;
}

.trend-neutral {
    color: #6c757d;
    font-weight: 600;
}

/* 图表卡片 */
.chart-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 20px;
    border: none;
}

.chart-card .chart-container {
    position: relative;
    height: 300px;
    margin-top: 1rem;
}

/* 列表样式 */
.scale-card,
.user-card,
.assessment-card {
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.scale-card:hover,
.user-card:hover,
.assessment-card:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

/* 信息卡片（用户详情页） */
.info-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    border: none;
}

.info-card .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.25rem;
    border-radius: 10px 10px 0 0;
    font-weight: 600;
}

.info-card .card-body {
    padding: 1.25rem;
}

.info-card .user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.info-card .user-avatar i {
    font-size: 2rem;
    color: white;
}